﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NGUYENMANHDUNG.OOP
{
    public partial class Demo : Form
    {
        public Demo()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //Khởi tạo đối tượng
            People objPeople01;
            People objPeople02;
            People objPeople03;
            People objPeople04;
            
            objPeople01 = new People("Nguyễn Văn Minh",2, 2,"Đen","VNI","Nam", 1);
            objPeople02 = new People("Phạm Hồng Nhung",2, 2,"Nâu","VNI","Nữ", 2);
            objPeople03 = new People("Hoàng Minh Hiếu",2, 2,"Vàng","VNI","Nam", 3);
            objPeople04 = new People("J.Brave",2, 2,"Đỏ","ENG","Nam", 4);



            //Hiển thị thông tin đối tượng
            listBox1.Items.Add("----------------1---------------------------------");
            listBox1.Items.Add("-FullName :" + objPeople01.FullName);
            listBox1.Items.Add("-Leg : " + objPeople01.LegNumber + "-Hand : " + objPeople01.HandNumber + "-ColorHair : " + objPeople01.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople01.Language);
            listBox1.Items.Add("-Sex : " + objPeople01.Sex);



            listBox1.Items.Add("----------------2---------------------------------");
            listBox1.Items.Add("-FullName :" + objPeople02.FullName);
            listBox1.Items.Add("-Leg : " + objPeople02.LegNumber + " - Hand : " + objPeople02.HandNumber + " - ColorHair : " + objPeople02.ColorHair);
            listBox1.Items.Add(" - Language : " + objPeople02.Language);
            listBox1.Items.Add("-Sex : " + objPeople02.Sex);

            listBox1.Items.Add("----------------3---------------------------------");
            listBox1.Items.Add("-FullName : " + objPeople03.FullName);
            listBox1.Items.Add("-Leg : " + objPeople03.LegNumber +  " - Hand : " + objPeople03.HandNumber + " - ColorHair : " + objPeople03.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople03.Language);
            listBox1.Items.Add("-Sex : " + objPeople03.Sex);

            listBox1.Items.Add("----------------4---------------------------------");
            listBox1.Items.Add("-FullName : " + objPeople04.FullName);
            listBox1.Items.Add("-Leg : " + objPeople04.LegNumber  +  " - Hand : " + objPeople04.HandNumber +   " - ColorHair : " + objPeople04.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople04.Language);
            listBox1.Items.Add("-Sex : " + objPeople04.Sex);


            objPeople01.FullName = "Nguyễn Văn Mạnh";
            objPeople01.ColorHair = "Đỏ";
            objPeople01.Language = "VNI , ENG";
            listBox1.Items.Add("----------------1---Đã cập nhật mới------------------------------");
            listBox1.Items.Add("-FullName :" + objPeople01.FullName);
            listBox1.Items.Add("-Leg : " + objPeople01.LegNumber + "-Hand : " + objPeople01.HandNumber + "-ColorHair : " + objPeople01.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople01.Language);
            listBox1.Items.Add("-Sex : " + objPeople01.Sex);



            objPeople02.FullName = "Phạm Thị Hồng Nhung";
            objPeople02.ColorHair =  "Tím";
            objPeople02.Language = "VNI , ENG";

            listBox1.Items.Add("----------------2---Đã cập nhật mới------------------------------");
            listBox1.Items.Add("-FullName :" + objPeople02.FullName);
            listBox1.Items.Add("-Leg : " + objPeople02.LegNumber + " - Hand : " + objPeople02.HandNumber + " - ColorHair : " + objPeople02.ColorHair);
            listBox1.Items.Add(" - Language : " + objPeople02.Language);
            listBox1.Items.Add("-Sex : " + objPeople02.Sex);


            objPeople03.ColorHair = "Xanh";
            objPeople03.Language = "VNI , ENG , KOREA";

            listBox1.Items.Add("----------------3---Đã cập nhật mới------------------------------");
            listBox1.Items.Add("-FullName : " + objPeople03.FullName);
            listBox1.Items.Add("-Leg : " + objPeople03.LegNumber + " - Hand : " + objPeople03.HandNumber + " - ColorHair : " + objPeople03.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople03.Language);
            listBox1.Items.Add("-Sex : " + objPeople03.Sex);


            objPeople04.ColorHair = "Vàng";
            objPeople04.Language = "ENG , VNI";
            listBox1.Items.Add("----------------4---Đã cập nhật mới------------------------------");
            listBox1.Items.Add("-FullName : " + objPeople04.FullName);
            listBox1.Items.Add("-Leg : " + objPeople04.LegNumber + " - Hand : " + objPeople04.HandNumber + " - ColorHair : " + objPeople04.ColorHair);
            listBox1.Items.Add("-Language : " + objPeople04.Language);
            listBox1.Items.Add("-Sex : " + objPeople04.Sex);






             


        }

        private void Demo_Load(object sender, EventArgs e)
        {
           

        }

        }
    
}
